<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let arr = [1,2,3,4,5];

        // 忽略解构
        // let [,b,,d] = arr;
        // console.log(b);
        // console.log(d);

        // 变量交换
        // let arr = [1,2];
        // let [a,b] = arr;
        // [a,b] = [b,a];

        // // console.log(arr2);
        // console.log(a,b);

        // 添加默认值
        // let arr= [1,2,3];
        // let [a,b,c,d=666] = arr;
        // console.log(a);
        // console.log(b);
        // console.log(c);
        // console.log(d);

        // 多维数组
        let arr = [
            [
                1
            ],
            [   2,
                [ 
                    3,
                    [
                        4,
                        5,
                        6
                    ]
                ]
            ]
        ];

        let [,[,[,[,,n]]]] = arr;

        console.log(n);



 

    </script>
</body>
</html>